<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<c:set var="contextPath" value="${pageContext.request.contextPath}"/>

	<form role="form" id="myform">
		<div class="form-title">
           	文件信息
        </div>
        <div class="row">
        	<input type="hidden" name="id" id="id" value="${doc.id }"/>
    
            <div class="col-sm-4">
               <div class="form-group">
                   <label for="idNumber">文件名称</label>
                   <input type="text" class="form-control" style="width:265px"
                          id="docName" name="docName" autocomplete="off" 
                   <c:if test="${htmlPageType == 'edit'}">
                   	     value="${doc.docName}" 
                   </c:if> 
                   placeholder="文件名称">
               </div>
            </div>   
   
	       <div class="col-sm-4">
	          <div class="form-group">
	              <label for="idNumber">文件上传日期</label>
	              <input type="text"  class="form-control" style="width:265px" 
	                     id="createTime" name="createTime" autocomplete="off" 
	                <c:if test="${htmlPageType == 'edit'}">
	              		  value="<fmt:formatDate 
	              		  type='date' pattern='yyyy-MM-dd' value='${doc.createTime}' />"
            		</c:if>
	               placeholder="文件上传日期">
	          </div>
	       </div>   
	
           <div class="col-sm-4">
               <div class="form-group">
                   <label for="idNumber">文件修改日期</label>
                   <input type="text" class="form-control" style="width:265px"
                          id="updateTime" name="updateTime" autocomplete="off" 
                   <c:if test="${htmlPageType == 'edit'}">
                   		value="<fmt:formatDate value='${doc.updateTime}' 
                   		type='date' pattern='yyyy-MM-dd'/>"
                   </c:if> 
                   placeholder="文件修改日期">
               </div>
           </div>
     
           <div class="col-sm-12">
	            <div class="form-group">
	               <label for="exampleInputEmail3">备注</label>
	               <span class="input-icon icon-right">
	                   <textarea class="form-control" rows="2" id="remark" name="remark">${doc.remark}</textarea>
	               </span>
	           	</div>
	       </div>
    
           <div class="form-group text-center">
				<c:if test="${htmlPageType == 'new'}">
			        <button type="button" class="btn btn-primary" onclick="server.submitForm('myform','/doc/add',common.validate,null,common.paginationQuery,1)">保存</button>
				</c:if>
				<c:if test="${htmlPageType == 'edit'}">
			        <button type="button" class="btn btn-primary" onclick="server.submitForm('myform','/doc/edit',common.validate,null,common.paginationQuery,1)">保存</button>
				</c:if>
	                <button type="button" class="btn btn-danger" onclick="server.closeModalBox()">关闭</button>
	        </div>
    
        </div>
	</form>
    
    
    <script src="${contextPath }/assets/ajaxupload/js/ajaxupload.3.6.js"></script>
	<script src="${contextPath }/assets/common/js/fileoperator.js"></script>
	
	<script type="text/javascript">
	$(document).ready(function() {
		server.loadSecondDatePick("#createTime");
		server.loadSecondDatePick("#updateTime"); 
		
		$("#createTime").on("change",function(){
			var createTimeVal = $("#createTime").val();
			var arr = createTimeVal.split("-");
			var b = arr[0];
			c = parseInt(b)+1;
			var str = "";
			for(var i=1;i<arr.length;i++){
				str = str+"-"+arr[i];
			}
			c = c+str;
			$("#updateTime").val(c);
		});
		
	});
</script>
	
	
	
	
	
	
	
	
	
	
	
	
    